﻿package mortal.game.view.mining
{
    import com.gengine.global.*;
    import flash.events.*;
    import mortal.game.cache.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;

    public class MiningHintIcon extends HintBaseIcon
    {
        private static var _instance:MiningHintIcon;

        public function MiningHintIcon(param1:String)
        {
            super(param1);
            return;
        }// end function

        override public function show(param1:int = 0, param2:int = 0) : void
        {
            super.show(param1, param2);
            Global.instance.addEnterSecond(this.everySecond);
            return;
        }// end function

        private function everySecond() : void
        {
            if (!Cache.instance.mining.hasBeAskForHelpInfos())
            {
                this.hide();
                return;
            }
            return;
        }// end function

        override public function hide() : void
        {
            super.hide();
            Global.instance.removeEnterSecond(this.everySecond);
            return;
        }// end function

        override protected function clickHandler(event:MouseEvent) : void
        {
            GameController.mining.showHelpPanel();
            return;
        }// end function

        public static function get instance() : MiningHintIcon
        {
            if (!_instance)
            {
                _instance = new MiningHintIcon(ImagesConst.taskMining_hintIcon);
            }
            return _instance;
        }// end function

    }
}
